//
//  KKBaseNetWorking.m
//  AFnetWorking测试
//
//  Created by long on 14-11-18.
//  Copyright (c) 2014年 谭启龙. All rights reserved.
//

#import "XLBaseNetWorking.h"

@implementation XLBaseNetWorking

#pragma mark --类方法
+(id)requestWithParameters:(NSMutableDictionary *)dic IndicatorView:(UIView *)view LoadingFinished:(sucBlock)sucBlock CacelLoading:(cancelBlock)cancelBlock LoadingError:(errorBlock)errorBlock
{
    
    
    XLBaseNetWorking * request = [[[self class]alloc]initWithParameters:dic IndicatorView:view LoadingFinished:sucBlock CacelLoading:cancelBlock LoadingError:errorBlock];
    return request;
}

+(id)cometWithParameters:(NSMutableDictionary *)dic LoadingFinished:(sucBlock)sucBlock LoadingError:(errorBlock)errorBlock {
    XLBaseAFNetWorking * net = [[[self class] alloc]initCometWithParam:dic LoadingFinished:sucBlock Error:errorBlock];
    return net;
}

#pragma mark --发送取消网络加载的通知
-(void)cancelLoading:(NSString *)noti
{
    [[NSNotificationCenter defaultCenter]postNotificationName:noti object:@"取消网络加载"];
}


//特殊参数 参见GJSHttpAgent类
//- (NSDictionary* )specialParams
//{
//    static NSDictionary* params = nil;
//    if (!params) {
//        NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
//        NSString *build = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
//        
//        
//        NSString *appId = nil;
//        
//#if HJ_VERSION
//        appId = @"hj";
//#endif
//        
//#if GJS_VERSION
//        appId = @"gjs";
//#endif
//        
//        params = [NSDictionary dictionaryWithObjectsAndKeys:\
//                  [NSNumber numberWithInt:[self osVersion]], @"osVersion",\
//                  @"iOS", @"app_key",\
//                  version, @"v",\
//                  build, @"build",\
//                  appId, @"appId",\
//                  nil];
//    }
//    
//    NSMutableDictionary* finalParams = [NSMutableDictionary dictionaryWithDictionary:params];
//    [finalParams setValue:kAppDelegate.accessToken forKey:@"token"];
//    
//    return finalParams;
//}


@end
